class LoginController {
	def index = { redirect(action:login,params:params) }

	def login = {

	}
	
	def doLogin = {
		def user = User.findWhere(username:params['username'], password:params['password'])
		if (user) {
			session.user = user
			session.setMaxInactiveInterval(86400)
			//redirect(uri:"/index.gsp")
			redirect(uri:"/MyApps.html")
		} else {
			redirect(action:'login')
		}
	}
}
